/**
* @file sle_socket_server.h
* @brief Header file for SLE socket server.
*
* This file contains the function declarations and macro definitions for the SLE socket server module.
* It includes definitions for service and property UUIDs, properties, and operation indications.
* It also declares functions for initializing the server, sending reports and notifications, and checking connection status.
* @author Maker Studio
* @license Apache 2.0
* This code is open-sourced under the Apache 2.0 license. When using open-source libraries
* or code, please ensure to acknowledge the original authors and sources.
**/
#ifndef SLE_SOCKET_SERVER_H
#define SLE_SOCKET_SERVER_H

#include <stdint.h>
#include "sle_ssap_server.h"
#include "errcode.h"

#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif /* __cplusplus */
#endif /* __cplusplus */

#define SLE_UUID_SERVER_SERVICE        0x2222
#define SLE_UUID_SERVER_NTF_REPORT     0x2323
#define SLE_UUID_TEST_PROPERTIES  (SSAP_PERMISSION_READ | SSAP_PERMISSION_WRITE)
#define SLE_UUID_TEST_OPERATION_INDICATION  (SSAP_OPERATE_INDICATION_BIT_READ | SSAP_OPERATE_INDICATION_BIT_WRITE)
#define SLE_UUID_TEST_DESCRIPTOR   (SSAP_PERMISSION_READ | SSAP_PERMISSION_WRITE)

errcode_t sle_server_init(void);
errcode_t sle_server_send_report_by_uuid(const uint8_t *data, uint8_t len);
errcode_t sle_server_send_notify_by_handle(const uint8_t *data, uint8_t len);
uint16_t sle_client_is_connected(void);
errcode_t sle_enable_server_cbk(void);
int sle_server_send_data(uint8_t *data,uint8_t length);
void sle_wait_client_paired(void);
void sle_wait_client_connected(void);

#ifdef __cplusplus
#if __cplusplus
}
#endif /* __cplusplus */
#endif /* __cplusplus */

#endif